package chapter10.innerclass.HomeWork;

/**
 * @Auther: Tx
 * @Date: 2022/5/3 13:36
 */
public class VehiclesFactory {
    private static Horse horse = new Horse();
    //由于马始终都是一匹，故采用单例设计模式

    private VehiclesFactory() {
        //构造器私有化
    }

    public static Horse getHorse(){
        return horse;
    }

  public static Boat getBoat(){
        return new Boat();
    }
    public static Airplane getAirplane(){
        return new Airplane();
    }
}
